package com.hkd.user_service.api;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hkd.common.api.ApiResponse;
import com.hkd.user_service.api.entity.SysRole;
import com.hkd.user_service.api.fallback.SysRoleServiceImplFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author HKD
 * @date 2022/8/20 18:10
 */
//@Component
@FeignClient(name = "user-service" ,
        contextId = "SysRoleService",
        fallbackFactory = SysRoleServiceImplFallback.class
)
public interface SysRoleService {
    @PostMapping("insertRole")
    ApiResponse insertRole(@RequestBody SysRole role);

    @GetMapping("getRoleByUserId")
    ApiResponse<List<String>> getRoleByUserId(@RequestParam("id") String id);

    /**
     * 根据账号获取权限路径
     * @param userId
     * @return
     */
    @GetMapping("getAuthPathByAccount")
    ApiResponse<List<String>> getAuthPathByUserId(String userId);
}
